package accs.model.io;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import accs.model.UserPasswordPair;

public abstract class UserPasswordReader {
	public abstract UserPasswordPair read() throws IOException;
	
	public List<UserPasswordPair> readAll() throws IOException {
		List<UserPasswordPair> list=new ArrayList<UserPasswordPair>();
		UserPasswordPair pair=null;
		
		while((pair=read())!=null) {
			list.add(pair);
		}
		
		close();
		
		return list;
	}
	
	public abstract void close() throws IOException;
}